# -*- coding: utf-8 -*-
"""
Created on Thu Jul  4 14:56:21 2024

@author: YANCL
"""

import cv2
import numpy as np

# img_input = cv2.imread("photo\\jjj.png", cv2.IMREAD_UNCHANGED)
# img_input = cv2.imread("photo\\ganraotu.bmp", cv2.IMREAD_UNCHANGED)
# img_input = cv2.imread("photo\\zhiwen.bmp", cv2.IMREAD_UNCHANGED)
img_input = cv2.imread("A3_Morphology\\photo\\zimu.png", cv2.IMREAD_UNCHANGED)
kernel = np.ones((2,2),np.uint8)   #core
result = cv2.morphologyEx(img_input, cv2.MORPH_OPEN, kernel)    # 这里注意写 cv2
cv2.imshow("Original", img_input)
cv2.imshow("Result", result)

cv2.waitKey()
cv2.destroyAllWindows()

